<template>
  <div>
    <el-link type="primary"  @click.native="viewContentHtml">{{packageCount}}</el-link>
    <el-dialog
      title="标签信息"
      :visible.sync="dialogView"
      style="height: 950px;width: 2000px">
      <el-table  :data="urlList" size="auto" >
        <el-table-column property="subWaybillNo" label="序号" >
        </el-table-column>
        <el-table-column property="boxNo" label="外箱号" >
        </el-table-column>
        <el-table-column property="trackNumber" label="追踪号" >
        </el-table-column>
        <el-table-column property="trackType" label="类型" >
        </el-table-column>
        <el-table-column property="weight" label="重量" >
        </el-table-column>
        <el-table-column property="length" label="长" >
        </el-table-column>
        <el-table-column property="width" label="宽" >
        </el-table-column>
        <el-table-column property="height" label="高" >
        </el-table-column>
        <el-table-column property="totalVolum" label="体积" >
        </el-table-column>
        <el-table-column property="volumeWeight" label="体积重" >
        </el-table-column>
        <el-table-column property="chargedWeight" label="计费重" >
        </el-table-column>
        <el-table-column property="labelUrl" label="标签" >
        </el-table-column>
      </el-table>
    </el-dialog>
  </div>
</template>
<script>
  import { ajax } from "@/store/yg/common/utils";

export default {
  props: ['data'],
  data() {
    return {
      urlList: [],
      trackList: false,
      dialogView: false,
      packageCount: "",
    }
  },
  mounted() {
    this.initData();
  },
  methods: {
    initData(){
      console.log(this.data)
      this.packageCount = this.data["inStockTotalPackages"]
    },
    viewContentHtml: function () {
      console.log(this.data)
      if (this.data["id"]) {
        var waybillId = this.data["id"];
        ajax("viewInStockData", {"id": waybillId}).then(
          res => {
            if (res.code == 200) {
              this.urlList = res.data;
              this.dialogView = true;
            }else{
              this.$message.error(res.message);
            }
          },
          error => {
            console.log(error);
          }
        );
      }
    }
  }

}
</script>
